function dictitemdict(typecode, dictcode, bindobject) {
	$.ajax({  
        type: "post",  
        url: "dictitem/" + typecode + "/" + dictcode,  
        dataType:'json',
        success: function(data) { 
        	var name = data.dictName;
        	bindobject.html(name);
        }  
    }); 
}

function dictitemtype(typecode, bindobject) {
	bindobject.empty();
	$.ajax({  
        type: "post",  
        url: "dictitem/" + typecode,  
        dataType:'json',
        success: function(data) { 
        	bindobject.append("<option value=''>请选择</option>"); 
        	$.each(data, function(i, item) {
        		bindobject.append("<option value='" + item.dictCode + "'>" + item.dictName + "</option>");
        	});  
        	bindobject.selectpicker('refresh'); 
        }  
    }); 
} 

function dictitemtype_selected(typecode, dictcode, bindobject) {
	bindobject.empty();
	$.ajax({  
        type: "post",  
        url: "dictitem/" + typecode,  
        dataType:'json',
        success: function(data) { 
        	bindobject.append("<option value=''>请选择</option>"); 
        	$.each(data, function(i, item) {
        		var dcode = item.dictCode;
        		var v = "<option value='" + dcode + "'";
        		if(dictcode == dcode) v = v + " selected";
        		v = v + ">" + item.dictName + "</option>";
        		bindobject.append(v);
        	});  
        	bindobject.selectpicker('refresh'); 
        }  
    }); 
} 


function region(parentcode, bindobject) {
	bindobject.empty();
	$.ajax({  
        type: "post",  
        url: "region/" + parentcode,  
        dataType:'json',
        success: function(data) { 
        	bindobject.append("<option value=''>请选择</option>"); 
        	$.each(data, function(i, item) {
        		bindobject.append("<option value='" + item.regionCode + "'>" + item.regionName + "</option>");
        	});  
        	bindobject.selectpicker('refresh'); 
        }  
    }); 
} 

function region_selected(parentcode, curcode, bindobject) {
	bindobject.empty();
	$.ajax({  
        type: "post",  
        url: "region/" + parentcode,  
        dataType:'json',
        success: function(data) { 
        	bindobject.append("<option value=''>请选择</option>"); 
        	$.each(data, function(i, item) {
        		var rcode = item.regionCode;
        		var v = "<option value='" + rcode + "'";
        		if(curcode == rcode) v = v + " selected";
        		v = v + ">" + item.regionName + "</option>";
        		bindobject.append(v);
        	});  
        	bindobject.selectpicker('refresh'); 
        }  
    }); 
} 